package com.jhgsys.internal.dict.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.wuwenze.poi.annotation.ExcelField;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 业务字典 Entity
 *
 * @author chenweihua
 * @date 2020-05-22 15:28:25
 */
@Data
@TableName("basic_dict")
public class Dict implements Serializable {

    /**
     * 编号
     */
    @TableId(value = "dict_id", type = IdType.ASSIGN_UUID)
    private String dictId;

    /**
     * 字典编码
     */
    @TableField("dict_code")
    @NotBlank(message = "{required}")
    @Size(max = 50, message = "{noMoreThan}")
    private String dictCode;

    /**
     * 字典名称
     */
    @TableField("dict_name")
    @NotBlank(message = "{required}")
    @Size(max = 100, message = "{noMoreThan}")
    private String dictName;

    /**
     * 状态 0：禁用 1：启用
     */
    @TableField("status")
    @ExcelField("状态")
    @NotBlank(message = "{required}")
    @Size(max = 2, message = "{noMoreThan}")
    private String status;

    /**
     * 描述
     */
    @TableField("remark")
    @Size(max = 100, message = "{noMoreThan}")
    private String remark;

    /**
     * 新增人
     */
    @TableField("created_by")
    @Size(max = 32, message = "{noMoreThan}")
    private String createdBy;

    /**
     * 新增时间
     */
    @TableField("created_time")
    @JsonFormat(pattern = "yyyy年MM月dd日 HH时mm分ss秒", timezone = "GMT+8")
    private Date createdTime;

    /**
     * 修改人
     */
    @TableField("updated_by")
    @Size(max = 32, message = "{noMoreThan}")
    private String updatedBy;

    /**
     * 修改时间
     */
    @TableField("updated_time")
    @JsonFormat(pattern = "yyyy年MM月dd日 HH时mm分ss秒", timezone = "GMT+8")
    private Date updatedTime;

    /**
     * 删除人
     */
    @TableField("deleted_by")
    @Size(max = 32, message = "{noMoreThan}")
    private String deletedBy;

    /**
     * 删除时间
     */
    @TableField("deleted_time")
    @JsonFormat(pattern = "yyyy年MM月dd日 HH时mm分ss秒", timezone = "GMT+8")
    private Date deletedTime;

    /**
     * 删除标记
     */
    @TableField("deleted_flg")
    private Byte deletedFlg;

    private transient List<DictItem> dictItems;
}